local skel = fk.CreateSkill {
  name = "emo__dubo",
}

Fk:loadTranslationTable{
  ["emo__dubo"] = "赌博之渊",
  [":emo__dubo"] = "出牌阶段，若你手牌数少于手牌上限，则可以将牌堆顶的牌当作【出其不意】对你使用并获得。",

  ["#emo__dubo"] = "赌博之渊：将牌堆顶的牌当作【出其不意】对你使用并获得",
}

skel:addEffect("active", {
  anim_type = "drawcard",
  prompt = "#emo__dubo",
  card_num = 0,
  target_num = 0,
  can_use = function(self, player)
    return player:getHandcardNum() < player:getMaxCards()
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local card = Fk:cloneCard("unexpectation")
    local cid = room:getNCards(1)[1]
    card.skillName = skel.name
    card:addSubcard(cid)
    room:useCard{
      from = player, tos = {player}, card = card
    }
    if not player.dead and room:getCardArea(cid) == Card.DiscardPile then
      room:obtainCard(player, cid, true, fk.ReasonPrey, player, skel.name)
    end
  end,
})

return skel
